<?php

use yii\db\Migration;

class m161104_022303_create_article extends Migration
{
    public function up()
    {
        $this->createTable('kd_article', [
            'wid'=>$this->primaryKey()->comment('主键'),
            'title'=>$this->string(50)->notNull()->comment('标题'),
            'author'=>$this->string(50)->notNull()->comment('对象'),
            'content'=>$this->text(3000)->notNull()->comment('正文'),
            'image'=>$this->string(200)->comment('图片/视频'),
            'class_id'=>$this->integer(10)->notNull()->comment('所属班级ID'),
            'yey_id'=>$this->integer(10)->notNull()->comment('所属幼儿园ID'),
            'yey_xz'=>$this->string(30)->notNull()->comment('幼儿园类型/性质'),
            'fb_time'=>$this->Datetime()->notNull()->comment('发布时间'),

        ]);

    }

    public function down()
    {
       $this->dropTable('kd_article');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
